package com.hitgo.soccer.database;

import java.sql.SQLException;

import com.danga.MemCached.MemCachedClient;
import com.hitgo.soccer.core.Team;

public class TeamDAO extends BaseDAO
{
	public static Team getTeam(Long strTeamID)
	{
		MemCachedClient mc = CacheFactory.getMCClient();
		String cacheKey = "getTeam_" + strTeamID;
		Team team = (Team) mc.get(cacheKey);
		if(team == null)
		{
			try
			{
				team = (Team) BaseDAO.queryForObject(strTeamID, "getTeam", strTeamID);
				if(team != null)
					mc.set(cacheKey, team);
				return team;
			}
			catch (SQLException e)
			{
				e.printStackTrace();
			}
		}
		return team;
	}
	
	// 
	public static void updateTeam(Team team)
	{
		
	}
	
	public static void updateTeamMoney(Team team)
	{
		
	}
	public static void insertTeam(Team team)
	{
		
	}
}
